package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.entity.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


import java.util.List;

public interface BrandMapper extends BaseMapper<Brand> {

    @Select("SELECT b.id,b.name,b.image,b.letter\n" +
            "FROM tb_category_brand cb\n" +
            "INNER JOIN tb_brand b ON cb.brand_id = b.id\n" +
            "WHERE cb.category_id = #{id}")
    List<Brand> queryById (@Param("id") Long id );
}
